package com.lagou.service.impl;

import com.lagou.mapper.ResumeMapper;
import com.lagou.model.Resume;
import com.lagou.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;

/**
 * @author songyi
 * @date 2020/6/17 0017 20:50
 * @description
 */
@Service
public class ResumeServiceImpl implements ResumeService {

    @Autowired
    private ResumeMapper resumeMapper;


    @Override
    public List<Resume> findAll() {
        return resumeMapper.findAll();
    }

    @Override
    public Resume findById(Long id) {
        Optional<Resume> optional = resumeMapper.findById(id);
        return optional.get();
    }

    @Override
    public Resume save(Resume resume) {
        return resumeMapper.save(resume);
    }

    @Override
    public void del(Long id) {
        resumeMapper.deleteById(id);
    }
}
